#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include "ConfProto.h"
#include "tblutil.h"
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\PIT.h>

const char*PITName = "PIT.dat";

static PIT_REC srPITRec;

static int recordNum;
int	inLoadPITRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(PIT_FILENAME, SIZE_PIT_REC, inRecNumber, (char *) &srPITRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetPITRec(void)
{
	return &srPITRec;

}

int	inSavePITRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(PIT_FILENAME, SIZE_PIT_REC, inRecNumber, (char *) &srPITRec);

	return inRet;
}

int	inGetPITRecNumber (void)
{
	return recordNum;
}

int	inUpdatePITRec (void)
{
	int inRet;

	inRet = inSaveConfRec(PIT_FILENAME, SIZE_PIT_REC, recordNum, (char *) &srPITRec);

	return inRet;
}

void	vdResetPITRec (void)
{
	memset((void*)&srPITRec, 0, REC_SIZEOF(srPITRec));
}

char* szGetTransTitle(void)
{
	return srPITRec.szTransTitle;
}

void vdSetTransTitle(const char* szTransTitle)
{
	strNumCopy(srPITRec.szTransTitle, szTransTitle, sizeof(((PIT_REC*)NULL)->szTransTitle)-1);
}

short inGetPwdLevel(void)
{
	return srPITRec.inPwdLevel;
}

void vdSetPwdLevel(short inPwdLevel)
{
	srPITRec.inPwdLevel = inPwdLevel;
}

